package com.example.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonBackReference;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
public class Product implements Serializable {
    @TableId(type = IdType.AUTO)
    @JsonBackReference
    private  Integer id;
    @JsonBackReference
    private  String name;
    @JsonBackReference
    private  String createBy;
    @JsonBackReference
    private  Date createTime;
    @JsonBackReference
    private  String updateBy;
    @JsonBackReference
    private  Date updateTime;

    /**
     * 这个方法是针对于mapper没有加上@Param注解，从而抛 There is no getter for property named 'product' in 'class com.example.entity.Product' 异常的解决方法
     * 该异常也可以加上@Param注解来解决
     * @return
     */
    public Product getProduct(){
        return this;
    }
}
